#include "guiapi.h" class MainWindow; GuiApi::GuiApi(QObject *parent, MainWindow* mw) : QObject(parent) { m_MainWindow = mw; m_CurrentWindowStyle = "normal"; m_WindowStyles << "normal" << "transparent" << "invisible"; } void GuiApi::setWindowSize(int w, int h) { m_MainWindow->resize(w,h); } QVariantMap GuiApi::getWindowSize() { QVariantMap size; size.insert("width", m_MainWindow->size().width()); size.insert("height", m_MainWindow->size().height()); return size; } void GuiApi::setWindowStyle(const QString& styleName) { Qt::WindowFlags flags; if (styleName=="transparent") { m_MainWindow->setStyleSheet("background:transparent;"); m_MainWindow->setAttribute(Qt::WA_TranslucentBackground, false); flags = Qt::Window; } else if (styleName=="normal") { m_MainWindow->setStyleSheet("background:white;"); m_MainWindow->setAttribute(Qt::WA_TranslucentBackground, false); flags = Qt::Window; } else if (styleName=="invisible") { m_MainWindow->setStyleSheet("background:transparent;"); m_MainWindow->setAttribute(Qt::WA_TranslucentBackground, true); flags = Qt::FramelessWindowHint; } m_MainWindow->setWindowFlags(flags); m_MainWindow->show(); m_CurrentWindowStyle = styleName; } QString GuiApi::getWindowStyle() { return m_CurrentWindowStyle; } QStringList GuiApi::getWindowStyles() { return m_WindowStyles; } void GuiApi::setWindowTitle(const QString & windowTitle) { m_MainWindow->setWindowTitle(windowTitle); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 8115 | David George |
a bunch of changes to the GuiApi - probably bound to change, though, so use at your own risk! beginnings of migrating to an "all windows are created equal" model. (as opposed to a MainWindow) removing the unreliable Qt execution of the .js methods - please include in your HTML (<script type="text/javascript" src="qrc:/js/ClientKitMethods.js"></script>) |
||
#1 | 8101 | David George |
beginning of _massive_ re-factoring your current build settings will fail create a new project from newly added .pro file (but change its p4api paths to match your old one) look for updated README as soon as Dave agrees that changes are _indeed_ for the best (Changes by Jaimen) |