Пример #1
0
void BitcoinGUI::createToolBars()
{
    QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
    toolbar->setObjectName("toolbar");
    addToolBar(Qt::LeftToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setFixedWidth(205);
    toolbar->setMovable( false );
    toolbar->setToolButtonStyle(Qt::ToolButtonTextOnly);

    QLabel* header = new QLabel();
    header->setMinimumSize(156,156);
    header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    header->setPixmap(QPixmap(":/images/header"));
    header->setMaximumSize(156,156);
    header->setContentsMargins(26,26,0,0);
    header->setScaledContents(true);
    toolbar->addWidget(header);

	QLabel *l = new QLabel(this);
    l->setPixmap(QPixmap(":/images/spacer"));
    toolbar->addWidget(l);
    toolbar->addAction(overviewAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
    toolbar->setStyleSheet("#toolbar {background: transparent; text-align: center; color: black;padding-right: 30px;} QToolBar QToolButton:hover {background-color: transparent;} QToolBar QToolButton:selected {background-color: transparent;} QToolBar QToolButton:checked {background-color: transparent;} QToolBar QToolButton:pressed {background-color: transparent;} QToolBar QToolButton {font-family:Steps; font-size:15px; font-weight: bold; min-width:125px;max-width:125px; min-height:25px;max-height:25px; color: white; text-align: left; }");

}
FlashableWidget::FlashableWidget(int width, int height, QWidget *parent):
    QWidget(parent) ,vLabels_(), width_(width), height_(height),
    vActiveLabels_(), inactiveLabelPalette(), activeLabelPalette(),
    backgroundPalette(), currentHalve(0), selectedHalveWidth(0),
    selectedHalveHeight(0), firstHalveWidth(0), firstHalveHeight(0),
    secondHalveWidth(0), secondHalveHeight(0)
{
    grid = new QGridLayout;

    QFont f("Helvetica", 20);
    for(int row = 0; row < height_; ++row)
    {
        for(int column = 0; column < width_; ++column)
        {
            QLabel *label = new QLabel();
            label->setFont(f);
            label->setScaledContents(true);
            label->setFrameShape(QFrame::Box);
            label->setLineWidth(3);
            label->setAlignment(Qt::AlignCenter);
            label->setPalette(inactiveLabelPalette);
            label->setAutoFillBackground(true);
            grid->addWidget(label, row, column);
            vLabels_.push_back(label);
        }
    }

    setLayout(grid);

    oneByOneIndex_ = 0;
}
Пример #3
0
void MainWindow::loadNewImage(QString pathName)
{
	if(sa == NULL)
	{return;}

	FileCentre *fc = FileCentre::GetInstance();
	QString path = fc->GetRecordPath();

	QDir dir(path);
	QStringList filter;
	filter<<"*.png"<<"*.jpg"<<"*.bmp";
	dir.setNameFilters(filter);
	int iNum = dir.count();
	if(iNum < 1)
	{return;}

	//MyLabel *lb = new MyLabel(mLW, pathName);
	QLabel *lb = WidgetFactory::GetLabel(mLW, pathName);
	lb->setGeometry(QRect(10, (iNum-1)*190, 180, 180));
	lb->setPixmap(pathName);
	lb->setScaledContents(true);
	lb->show();
	/*
	sa->setWidget(mLW);
	sa->setGeometry(0,0, 210, 820);
	mLW->setGeometry(0,0,190,190*(iNum+1));
	mLW->show();
	sa->show();
	*/
	mLW->setGeometry(0,0,190,190*(iNum+1));
}
Пример #4
0
void BitcoinGUI::createToolBars()
{
    toolbar = new QToolBar(tr("Tabs toolbar"));
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
    toolbar->setObjectName("tabs");
    toolbar->setStyleSheet("QToolButton { color: #ffffff; } QToolButton:hover { background-color: #050817 } QToolButton:checked { background-color: #152443 } QToolButton:pressed { background-color: #152443 } #tabs { color: #ffffff; background-color: qradialgradient(cx: -0.8, cy: 0, fx: -0.8, fy: 0, radius: 0.6, stop: 0 #404040, stop: 1 #101010);  }");

    QLabel* header = new QLabel();
    header->setMinimumSize(48, 48);
    header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    header->setPixmap(QPixmap(":/icons/bitcoin"));
    header->setMaximumSize(48,48);
    header->setScaledContents(true);
    toolbar->addWidget(header);

    //QMenu *toolbarMenu = new QMenu();
    toolbar->addAction(overviewAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
    toolbar->addAction(masternodeManagerAction);
    toolbar->addAction(messageAction);

    toolbar->setOrientation(Qt::Horizontal);
    toolbar->setMovable(false);

    addToolBar(Qt::TopToolBarArea, toolbar);
}
Пример #5
0
QLayout *AboutDlg::initTitleLayout()
{
    // The title layout has the product title, a picture, a horizontal
    // user guide layout, and a GPL 3 label.

    titleLabel = new QLabel();
    titleLabel->setMaximumSize(250, 64);
    titleLabel->setAlignment(Qt::AlignCenter);

    QLabel * tombImage = new QLabel();
    tombImage->setMaximumSize(250, 250);
    tombImage->setPixmap(QPixmap(":/images/tomb.png"));
    tombImage->setScaledContents(true);
    tombImage->setAlignment(Qt::AlignCenter);

    gplLabel = new QLabel();
    gplLabel->setMaximumSize(250, 32);
    gplLabel->setAlignment(Qt::AlignCenter);

    QVBoxLayout * titleLayout = new QVBoxLayout();
    titleLayout->setSpacing(15);
    titleLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding));
    titleLayout->addWidget(titleLabel);
    titleLayout->addWidget(tombImage);
    titleLayout->addLayout(initUserGuideLayout());
    titleLayout->addWidget(gplLabel);
    titleLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding));

    return titleLayout;
}
QLabel * TASARIM_DESIGN_WIDGET::CREATE_NEW_LABEL ( const QString &text, QWidget * parent )
{
    if ( parent EQ NULL ) {
        parent = this;
    }

    QLabel * label = new QLabel(text.toUtf8(),parent);
    label->setMargin(0);
    label->setIndent(0);
    QFont label_font = label->font();
    label_font.setFixedPitch    ( false );
    label_font.setKerning       ( false );
    label_font.setLetterSpacing ( QFont::AbsoluteSpacing, 0.01 );
    label_font.setWordSpacing   ( 0.01 );
    label->setScaledContents    ( true );
    label->setFont              ( label_font );
    label->setFocusPolicy       ( Qt::StrongFocus );

    int width = label->width();
    label->setMinimumWidth( width + 5 );

    label->installEventFilter( this );

    SET_LABEL_FONTS_UNSELECTED( label );

    return label;
}
Пример #7
0
void BitcoinGUI::createToolBars()
{
    toolbar = new QToolBar(tr("Tabs toolbar"));
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
    toolbar->setObjectName("tabs");
    toolbar->setStyleSheet("QToolButton { color: #ffffff; }  } #tabs { color: #ffffff; background-color: #37c5db;}");

    QLabel* header = new QLabel();
    header->setMinimumSize(96, 96);
    header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    header->setPixmap(QPixmap(":/images/header"));
    header->setMaximumSize(96,96);
    header->setScaledContents(true);
    toolbar->addWidget(header);

    //QMenu *toolbarMenu = new QMenu();
    toolbar->addAction(overviewAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
    toolbar->addAction(masternodeManagerAction);
    toolbar->addAction(richListPageAction);
    toolbar->addAction(messageAction);

    toolbar->setOrientation(Qt::Horizontal);
    toolbar->setMovable(false);

    addToolBar(Qt::TopToolBarArea, toolbar);
}
Пример #8
0
static QLabel *create_label(const QImage &image)
{
    QLabel *label = new QLabel();
    label->setPixmap(QPixmap::fromImage(image));
    label->setScaledContents(true);
    return label;
}
Пример #9
0
void MainWindow::refreshScore()
{
    if(enemyKilled)
    {
        enemyKilled = false;
        int num = player->score;
        clearScore();

        do
        {
            int index = num%10;
            num /= 10;
            QPixmap temp(this->numbers[index]);
            QLabel* templbl = new QLabel();
            templbl->setPixmap(temp);
            templbl->setFixedSize(15,15);
            templbl->setScaledContents(true);
            templbl->setParent(this);
            scoreNumbers->append(templbl);

        }while(num != 0);

        int start = 30 + (30* scoreNumbers->size());
        for(int i = 0; i < scoreNumbers->size(); i++)
        {
            scoreNumbers->at(i)->move(start, 30);
            scoreNumbers->at(i)->show();
            start -=30;
        }
    }
}
Пример #10
0
void MainWindow::on_actionQueue3_triggered()  //Show Sky Map
{
    /*QDialog * dial = new QDialog;
    dial->setBaseSize(1300,800);
    dial->setWindowTitle("Sky map");
    //dial->setStyleSheet("background: url(:/new/prefix1/skymap_source.png)");*/

    QLabel *image = new QLabel();
    image->setPixmap( QPixmap( ":/new/prefix1/skymap_source.png" ) );

    image->setBackgroundRole(QPalette::Base);
    image->setBaseSize(1200,800);
    image->setScaledContents(true);

    QScrollArea * scrollArea = new QScrollArea;
    //scrollArea->setBackgroundRole(QPalette::Dark);
    scrollArea->setBaseSize(1200,800);
    scrollArea->setWidget(image);
    scrollArea->setWindowTitle("Sky map");
    scrollArea->show();
    //setCentralWidget(scrollArea);

    /*QVBoxLayout * mainLayout = new QVBoxLayout();

    dial->setLayout(mainLayout);

    dial->exec();*/

}
Пример #11
0
SearchEdit::SearchEdit(QWidget *parent)
                    :QLineEdit(parent){
    QPixmap searchIcon(":search.png");
    QLabel* lbl = new QLabel(this);
    lbl->setScaledContents(true);
    lbl->setPixmap(searchIcon);
    lbl->setFixedSize(QSize(21,21));
    lbl->setStyleSheet("QLabel { border: none; padding: 0px; margin-left: 9px; margin-top: 8px;}");
    clearButton = new QToolButton(this);
    QPixmap pixmap(":clear_left.png");
      clearButton->setIcon(QIcon(pixmap));
      clearButton->setIconSize(QSize(18,18));
    clearButton->setCursor(Qt::ArrowCursor);
    clearButton->setStyleSheet("QToolButton { border: none; padding: 0px; margin-right: 2px; margin-top: 3px;}");
    clearButton->hide();
      setAttribute(Qt::WA_MacShowFocusRect, false);
      connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));
      connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(updateCloseButton(const QString&)));
      int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
      //setStyleSheet(QString("QLineEdit { padding-right: %1px; } ").arg(clearButton->sizeHint().width() + frameWidth + 1));
      QSize msz = minimumSizeHint();
      setMinimumSize(qMax(msz.width(), clearButton->sizeHint().height() + frameWidth * 2 + 2),
                     qMax(msz.height(), clearButton->sizeHint().height() + frameWidth * 2 + 2));
    
                    }        
Пример #12
0
Menu::Menu(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Menu)
{
    ui->setupUi(this);
    setWindowFlags(Qt::WindowStaysOnTopHint);
    setWindowModality(Qt::ApplicationModal);
    setWindowTitle("Tandem Techies");
    setFixedSize(geometry().width(), geometry().height());

    QIcon icon(":/images/player.png");
    setWindowIcon(icon);

    QLabel* background = new QLabel(this);
    QPixmap backgroundImg(":/images/bg.png");
    background->setPixmap(backgroundImg);
    background->setGeometry(0, 0, geometry().width(), geometry().height());
    background->setScaledContents(true);
    background->lower();
    background->show();

    //Make the logo's background transparent
    ui->lblLogo->setAttribute(Qt::WA_TranslucentBackground);

    //Make the menu border invisible
    setWindowFlags(Qt::MSWindowsFixedSizeDialogHint);
    setWindowFlags(Qt::CustomizeWindowHint);
    setWindowFlags(Qt::FramelessWindowHint);
}
Пример #13
0
void MorePage::initializeWidget()
{
    //导航栏
    QString strTitle = tr("更多...");
    navigationBar = new NavigationBar(this);
    navigationBar->setTitleText(strTitle);

    QHBoxLayout* pHLTop = new QHBoxLayout();
    pHLTop->addWidget(navigationBar);
    pHLTop->setSpacing(0);
    pHLTop->setMargin(0);
    this->setTopbarLayout(pHLTop);


    //个人信息
    QLabel* themeWidget = new QLabel;
    QPixmap pixmap = QPixmap(ImagePath::MOREPAGE_THEME);
    pixmap.setDevicePixelRatio(2);
    themeWidget->setAutoFillBackground(true);
    themeWidget->setFixedHeight(this->screenHeight()*0.25);
    themeWidget->setFixedWidth(this->screenWidth());
    themeWidget->setPixmap(pixmap);
    themeWidget->setScaledContents(true);

    btnPersonalInfo = new QToolButton;
    btnPersonalInfo->setFixedWidth(this->screenWidth());
    btnPersonalInfo->setFixedHeight(this->screenHeight()*0.15);
    btnPersonalInfo->setIconSize(QSize(btnPersonalInfo->height()*0.7, btnPersonalInfo->height()*0.7));
    btnPersonalInfo->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    btnPersonalInfo->setStyleSheet("font:16px; color:white;background-color:rgba(0,0,0,0)");
    connect(btnPersonalInfo, SIGNAL(clicked()), SLOT(on_btnPersonal_clicked()));

    QVBoxLayout* themeLayout = new QVBoxLayout;
    themeLayout->addWidget(btnPersonalInfo);
    themeLayout->setMargin(0);
    themeWidget->setLayout(themeLayout);

    //设置
    btnSetting = new GroupButton;
    btnSetting->setStyleSheet(SheetStyle::GROUPBUTTON_BOTTOMBORDER);
    QPixmap settingPixmap(ImagePath::SETTING);
    this->setGroupButton(btnSetting, settingPixmap, tr("设置"));
    connect(btnSetting, SIGNAL(clicked()), SLOT(on_btnSetting_clicked()));

    QVBoxLayout* vblTotalLayout = new QVBoxLayout;
    vblTotalLayout->addWidget(themeWidget);
    vblTotalLayout->addSpacing(this->screenHeight()*0.026);
    vblTotalLayout->addWidget(btnSetting);
    vblTotalLayout->setAlignment(Qt::AlignTop);
    vblTotalLayout->setMargin(0);
    vblTotalLayout->setSpacing(0);
    this->setBodyPartLayout(vblTotalLayout);

    //屏幕触摸滚动设置
    this->setBodyScreenHeight(this->scrollAreaHasBottomBarHeight());
    this->installScrollViewportArea();
    this->loadLocalData(curAccountID);
}
Пример #14
0
AboutDialog::AboutDialog()
{
    this->setWindowTitle(tr("About"));

    QGridLayout *layout = new QGridLayout;
    this->setLayout(layout);

    QLabel *icon = new QLabel(this);
    icon->setPixmap(QIcon(":/img/icon.svg").pixmap(QSize(128, 128)));
    icon->setFixedSize(128, 128);
    icon->setScaledContents(true);
    layout->addWidget(icon, 0, 0, 2, 1, Qt::AlignTop);

    QLabel *text = new QLabel(this);
    text->setText(QString("<b>Edah %1</b><br/>").arg(utils->getAppVersion()) +
                  "<br/>" +
                  tr("Edah (heb. ʽe&middot;dhahʹ, eng. assembly) - program that handles multimedia during meetings. "
                       "Edah can be extended by plugins (for example: \"Player\", \"Recorder\", \"Stream\"), "
                       "supports touchscreen and is fully configurable.<br/>") +
                  "WWW: <a href=\"http://edah.tk\">edah.tk</a>");
    text->setOpenExternalLinks(true);
    text->setWordWrap(true);
    layout->addWidget(text, 0, 1);

    QLabel *text2 = new QLabel(this);
    text2->setText("<br/>"
                   "This software contains:<br/>"
                   "&#8226; <a href=\"http://www.typicons.com/\">Typicons</a> by Stephen Hutchings licensed under <a href=\"https://creativecommons.org/licenses/by-sa/3.0/\">CC BY-SA</a><br/>"
                   "&#8226; <a href=\"https://www.openssl.org/\">OpenSSL</a> by The OpenSSL Project licensed under <a href=\"https://raw.githubusercontent.com/openssl/openssl/master/LICENSE\">OpenSSL License</a><br/>"
                   "&#8226; <a href=\"https://github.com/qtproject/qt-solutions/tree/master/qtsingleapplication\">QtSingleApplication</a> by Digia Plc and/or its subsidiary(-ies) licensed under BSD license<br/>"
                   "&#8226; <a href=\"http://www.google.com/fonts/specimen/Open+Sans\">Open Sans</a> by Steve Matteson licensed under <a href=\"http://www.apache.org/licenses/LICENSE-2.0\">Apache License 2.0</a><br/>"
                   "<br/>");
    text2->setOpenExternalLinks(true);
    text2->setWordWrap(false);
    layout->addWidget(text2, 1, 1);

    QLabel *text3 = new QLabel(this);
    text3->setText("This application uploads to update server data such as unique device ID, "
                   "version of your operating system and IP address.<br/><br/>"
                   "Copyright (C) 2016-2017 Łukasz Matczak &lt;<a href=\"mailto:[email protected]\">[email protected]</a>&gt;<br/>"
                   "This program comes with ABSOLUTELY NO WARRANTY. This is "
                   "free software, and you are welcome to redistribute it under "
                   "certain conditions; ");
#ifdef Q_OS_WIN
    text3->setText(text3->text() +
                   "<a href=\"LICENSE.txt\">click here</a> for details.");
#endif
    text3->setOpenExternalLinks(true);
    text3->setWordWrap(true);
    layout->addWidget(text3, 2, 1);

    QDialogButtonBox *btns = new QDialogButtonBox(QDialogButtonBox::Close);
    QPushButton *closeBtn = btns->button(QDialogButtonBox::Close);
    closeBtn->setText(tr("Close"));
    connect(closeBtn, &QPushButton::clicked, this, &AboutDialog::close);
    layout->addWidget(btns, 3, 0, 1, 2);
}
Пример #15
0
void ccRenderingTools::ShowDepthBuffer(ccGBLSensor* sensor, QWidget* parent)
{
	if (!sensor)
		return;

	const ccGBLSensor::DepthBuffer& depthBuffer = sensor->getDepthBuffer();
	if (!depthBuffer.zBuff)
		return;

	//determine min and max depths
	ScalarType minDist = 0, maxDist = 0;
	{
		const ScalarType *_zBuff = depthBuffer.zBuff;
		for (int x=0; x<depthBuffer.height*depthBuffer.width; ++x,++_zBuff)
		{
			if (x==0)
			{
				maxDist = minDist = *_zBuff;
			}
			else if (*_zBuff > 0)
			{
				maxDist = std::max(maxDist,*_zBuff);
				minDist = std::min(minDist,*_zBuff);
			}
		}
	}

	QImage bufferImage(depthBuffer.width,depthBuffer.height,QImage::Format_RGB32);
	{
		ccColorScale::Shared colorScale = ccColorScalesManager::GetDefaultScale();
		assert(colorScale);
		ScalarType coef = maxDist-minDist < ZERO_TOLERANCE ? 0 : static_cast<ScalarType>(ccColorScale::MAX_STEPS-1)/(maxDist-minDist);

		const ScalarType* _zBuff = depthBuffer.zBuff;
		for (int y=0; y<depthBuffer.height; ++y)
		{
			for (int x=0; x<depthBuffer.width; ++x,++_zBuff)
			{
				const colorType* col = (*_zBuff >= minDist ? colorScale->getColorByIndex(static_cast<unsigned>((*_zBuff-minDist)*coef)) : ccColor::black);
				bufferImage.setPixel(x,depthBuffer.height-1-y,qRgb(col[0],col[1],col[2]));
			}
		}
	}

	QDialog* dlg = new QDialog(parent);
	dlg->setWindowTitle(QString("%0 depth buffer [%1 x %2]").arg(sensor->getParent()->getName()).arg(depthBuffer.width).arg(depthBuffer.height));
	dlg->setFixedSize(bufferImage.size());
	QVBoxLayout* vboxLayout = new QVBoxLayout(dlg);
	vboxLayout->setContentsMargins(0,0,0,0);
	QLabel* label = new QLabel(dlg);
	label->setScaledContents(true);
	vboxLayout->addWidget(label);

	label->setPixmap(QPixmap::fromImage(bufferImage));
	dlg->show();
}
Пример #16
0
 foreach(const ElementTypes &elementType, getAvailableElementTypes()){
     QLabel *element = new QLabel();
     element->setPixmap(QPixmap(getElementTypeIconPath(elementType)));
     element->setFixedHeight(30);
     element->setFixedWidth(30);
     element->setScaledContents(true);
     element->setVisible(false);
     this->layout_neededElements->addWidget(element);
     this->neededElements.insert(elementType, element);
 }
Пример #17
0
void MainWindow::changeSlot(QString path)
{
	//TODO:路径需动态修改
	//if(path == "")
	//{
	//	path = "f:/img";
	//}
	

	//文件路径过滤
	QDir dir(path);
	QStringList filter;
	filter<<"*.png"<<"*.jpg"<<"*.bmp";
	dir.setNameFilters(filter);
	int imageNum = dir.count();
	QFileInfoList fileInfo = dir.entryInfoList();
	
	//加载图片和滚动区域
	if(sa != NULL)
	{
		delete sa;
		sa = NULL;
	}

	sa = new QScrollArea(ui.wgImage);
	sa->setFrameShape(QFrame::NoFrame);

	
	mLW = new QWidget(sa);
	for(int i=0; i<imageNum; i++)
	{
		//获取文件全路径
		QString s = fileInfo.at(i).filePath();

		//MyLabel *lb = new MyLabel(mLW,s);	
		QLabel *lb = WidgetFactory::GetLabel(mLW, s);
        lb->setGeometry(QRect(10, i*190, 180, 180));

		lb->setPixmap(s);
		lb->setScaledContents(true);

	}
	//设置大小后有滚动区域
	sa->setWidget(mLW);
	sa->setGeometry(0,0, 210, 820);
	mLW->setGeometry(0,0,190,190*(imageNum+1));

	sa->show();

}
QLabel    *QWindowAPI::CreateImage(QWidget *widget, const QString filename, int height, int width, int pos_x, int pos_y)
{
    QLabel *label = new QLabel(widget);
    QImage image = QImage();

    bool tmp = image.load(filename);
    if (!tmp)
        QMessageBox::warning(this, "Error", "Failed to load image", 0, 0);
    label->setFixedSize(width, height);
    label->move(pos_x, pos_y);
    label->setPixmap(QPixmap::fromImage(image));
    label->setScaledContents(true);
    label->show();
    return (label);
}
Пример #19
0
MainWindow::MainWindow(QWidget *parent)
    : QWidget(parent)
{
    currentScreen = "title";
    dataSent = false;

    //Application Logo
    QLabel *title = new QLabel;
    title->setAlignment(Qt::AlignHCenter);
    title->setPixmap(loadLogo());
    title->setScaledContents(true);

    //Screens
    screenTitle         = new ScreenTitle(this);
    industryElectricity = new IndustryElectricity(this);    industryElectricity->hide();
    industryHeat        = new IndustryHeat(this);           industryHeat->hide();
    industrySteam       = new IndustrySteam(this);          industrySteam->hide();
    homeElectricity     = new HomeElectricity(this);        homeElectricity->hide();
    homeHeat            = new HomeHeat(this);               homeHeat->hide();
    homePV              = new HomePV(this);                 homePV->hide();
    homeHabitat         = new HomeHabitat(this);            homeHabitat->hide();
    finalScreen         = new FinalScreen(this);            finalScreen->hide();

    //Previous & Next
    prev = new QPushButton(tr("Quit"));
    next = new QPushButton(tr("Next >"));

    //Grid Layout
    layoutMainWindow.addWidget(title,               0, 0, 1, 2);
    layoutMainWindow.addWidget(screenTitle,         1, 0, 1, 2);
    layoutMainWindow.addWidget(industryElectricity, 1, 0, 1, 2);
    layoutMainWindow.addWidget(industryHeat,        1, 0, 1, 2);
    layoutMainWindow.addWidget(industrySteam  ,     1, 0, 1, 2);
    layoutMainWindow.addWidget(homeElectricity,     1, 0, 1, 2);
    layoutMainWindow.addWidget(homeHeat,            1, 0, 1, 2);
    layoutMainWindow.addWidget(homePV,              1, 0, 1, 2);
    layoutMainWindow.addWidget(homeHabitat,         1, 0, 1, 2);
    layoutMainWindow.addWidget(finalScreen,         1, 0, 1, 2);
    layoutMainWindow.addWidget(prev,                2, 0, 1, 1);
    layoutMainWindow.addWidget(next,                2, 1, 1, 1);
    layoutMainWindow.setRowStretch(0, 0);
    layoutMainWindow.setRowStretch(1, 1);
    layoutMainWindow.setRowStretch(2, 0);
    setLayout(&layoutMainWindow);

    connect(prev, SIGNAL(clicked()), this, SLOT(previousScreen()));
    connect(next, SIGNAL(clicked()), this, SLOT(nextScreen()));
}
Пример #20
0
void DarkSilkGUI::createToolBars() {
    QLabel* header = new QLabel();
    header->setMinimumSize(48, 48);
    header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    header->setPixmap(QPixmap(":/icons/darksilk"));
    header->setMaximumSize(48, 48);
    header->setScaledContents(true);

    toolbar = new QToolBar(tr("Tabs toolbar"));
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
    toolbar->setObjectName("tabs");
    toolbar->setStyleSheet("#tabs { background-color: qradialgradient(cx: -0.8, cy: 0, fx: -0.8, fy: 0, radius: 0.6, stop: 0 #000000, stop: 1 #000000);  }");
    toolbar->addWidget(header);

    QMenu *toolbarMenu = new QMenu();
    toolbarMenu->addAction(overviewAction);
    toolbarMenu->addAction(receiveCoinsAction);
    toolbarMenu->addAction(sendCoinsAction);
    toolbarMenu->addAction(historyAction);
    toolbarMenu->addAction(addressBookAction);
    toolbarMenu->addAction(statisticsAction);
    toolbarMenu->addAction(blockAction);
    toolbarMenu->addAction(stormnodeManagerAction);

    QAction* menuAction = new QAction(QIcon(":/icons/overview"), tr("&Menu"), this);
    menuAction->setToolTip(tr("Access DarkSilk Wallet Tabs"));
    menuAction->setCheckable(false);

    QToolButton* menuToolButton = new QToolButton();
    menuToolButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
    menuToolButton->setMenu(toolbarMenu);
    menuToolButton->setPopupMode(QToolButton::InstantPopup);
    menuToolButton->setDefaultAction(menuAction);

    netLabel = new QLabel();
    netLabel->setObjectName("netLabel");
    netLabel->setStyleSheet("#netLabel { color: #ffffff; }");

    toolbar->addWidget(menuToolButton);
    toolbar->addWidget(makeToolBarSpacer());
    toolbar->addWidget(netLabel);
    toolbar->setOrientation(Qt::Horizontal);
    toolbar->setMovable(false);

    addToolBar(Qt::TopToolBarArea, toolbar);
}
Пример #21
0
  void ModelExplorer::createLayout()
  {
    QPixmap  pixmap(":/systemOutliner.JPG");
    QLabel * systemOutlinerLabel = new QLabel(this);
    systemOutlinerLabel->setPixmap(pixmap);
    systemOutlinerLabel->setScaledContents(true);

    /* int treeIdx = */ mStackedWidget->addWidget(mTreeViewWidget);
    /* int classIdx = */ mStackedWidget->addWidget(mClassViewWidget);
    /* int systemOutlinerIdx = */ mStackedWidget->addWidget(systemOutlinerLabel);

    QVBoxLayout * mainLayout = new QVBoxLayout();
    mainLayout->addWidget(mToolBar);
    mainLayout->addWidget(mSplitter);

    setLayout(mainLayout);
  }
Пример #22
0
void NotificationWidget::addMessage(QString msg, QPixmap pic) {
//#ifndef Q_WS_MAC
    QHBoxLayout *l = new QHBoxLayout();
    QLabel *w = new QLabel();
    w->setMaximumSize(16,16);
    w->setPixmap(pic);
    w->setScaledContents(true);
    l->addWidget(w);
    w=new QLabel();
    w->setText(msg);
    l->addWidget(w);
    ((QBoxLayout*)layout())->addLayout(l);
//#endif
//#ifdef Q_WS_MAC
//	icons.append(pic);
//	text.append(msg);
//#endif
}
void WindowUser::ReadXML()
{


        doc.LoadFile();

       TiXmlNode *patr=doc.FirstChild();


    int i=0;
    while(patr){
        int x,y;


        TiXmlAttribute *atrX =patr->ToElement()->FirstAttribute();
        TiXmlAttribute *atrY =patr->ToElement()->LastAttribute();


        atrX->Next()->QueryIntValue(&x);
        //cout<<x<<endl;

        atrY->QueryIntValue(&y);
        //cout<<y<<endl;


//        cout<<patr->ToElement()->Attribute("Codigo")<<endl;
//        cout<<patr->ToElement()->Attribute("X")<<endl;
//        cout<<patr->ToElement()->Attribute("Y")<<endl;

          QLabel *pin =new QLabel(this);
          QPixmap qp=QPixmap(":/imgs/map-pin-md.png");
          pin->setPixmap(qp);
          pin->setGeometry(x,y,20,25);
          pin->setScaledContents(true);
          pin->raise();
          pin->show();
        patr=patr->NextSibling();
        i++;
    }



}
Пример #24
0
AMWorkflowView3::AMWorkflowView3(AMActionRunner3 *actionRunner, QWidget *parent) :
	QWidget(parent)
{
	layoutSpacer_ = 0;

	QHBoxLayout* hl = new QHBoxLayout();
	hl->setContentsMargins(12,12,12,12);
	hl->setSpacing(12);

	QLabel* titleIcon = new QLabel();
	titleIcon->setMaximumSize(36,36);
	titleIcon->setPixmap(QPixmap(":/user-away.png"));
	titleIcon->setScaledContents(true);
	hl->addWidget(titleIcon);
	QLabel* titleLabel = new QLabel(actionRunner->actionRunnerTitle());
	titleLabel->setStyleSheet("font: " AM_FONT_XLARGE_ "pt \"Lucida Grande\";\ncolor: rgb(79, 79, 79);");
	hl->addWidget(titleLabel);
	hl->addStretch(1);
	addActionButton_ = new QPushButton("Add Action...");
	hl->addWidget(addActionButton_);

	currentView_ = new AMActionRunnerCurrentView3(actionRunner);
	queueView_ = new AMActionRunnerQueueView3(actionRunner);
	historyView_ = new AMActionHistoryView3(actionRunner, actionRunner->loggingDatabase());
	addActionDialog_ = 0;

	QVBoxLayout* vl = new QVBoxLayout();
	vl->setContentsMargins(0,0,0,0);
	vl->setSpacing(0);

	vl->addLayout(hl);
	vl->addWidget(historyView_);
	vl->addSpacing(12);
	vl->addWidget(currentView_);
	vl->addSpacing(12);
	vl->addWidget(queueView_);

	setLayout(vl);

	connect(queueView_, SIGNAL(collapsed(bool)), this, SLOT(onViewCollapsed()));
	connect(historyView_, SIGNAL(collapsed(bool)), this, SLOT(onViewCollapsed()));
	connect(addActionButton_, SIGNAL(clicked()), this, SLOT(onAddActionButtonClicked()));
}
Пример #25
0
ZAboutDialog::ZAboutDialog()
    :MyBaseDlg()
{
  setMainWidgetTitle ( "zCleaner" );

  QString ProgDir = QString ( qApp->argv() [0] ) ;
  int i = ProgDir.findRev ( "/" );
  ProgDir.remove ( i+1, ProgDir.length() - i );
  QWidget *myWidget = new QWidget ( this );
  //myWidget->setGeometry(0,0,240,320);
  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );
  QHBoxLayout *myHBoxLayout = new QHBoxLayout;
  myHBoxLayout->setSpacing ( 4 );
  myHBoxLayout->setMargin ( 0 );

  QLabel *myLabel = new QLabel ( myWidget );
  myLabel->setPixmap ( QPixmap ( "folder.png" ) );
  myLabel->setScaledContents ( false );
  myHBoxLayout->addWidget ( myLabel );

  myLabel = new QLabel ( QString ( "<qt><img src=%1/img/zCleaner_usr.png><br>"
"<qt>zCleaner 0.3 by c_ro87<br>" "<qt>Base GUI zGui 0.7.4g by BeZ<br>"
                                   "<font size=\"-1\">zCleaner is a simple antivirus for Z6</font></qt>" ).arg(ProgDir), myWidget );
  myHBoxLayout->addWidget ( myLabel, 1 );
  myVBoxLayout->addLayout ( myHBoxLayout );

  myLabel = new QLabel ( QString ( "<qt><font size=\"-1\"><p>Copyright (C) 2008 c_ro87<br>"
                                   "<tt>&lt;[email protected]&gt;</tt><br></font></qt>" ),
                         myWidget );
  myVBoxLayout->addWidget ( myLabel );

  QSpacerItem* spacer = new QSpacerItem ( 8, 8, QSizePolicy::Minimum, QSizePolicy::Expanding );
  myVBoxLayout->addItem ( spacer );

  myLabel = new QLabel ( "www.modmymoto.com", myWidget );
  myVBoxLayout->addWidget ( myLabel );
  setContentWidget ( myWidget );

  ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );
  softKey->setText ( ZSoftKey::LEFT, "OK", ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( accept() ) );
  setCSTWidget ( softKey );
}
Пример #26
0
ZAboutDialog::ZAboutDialog()
    :MyBaseDlg()
{

  setMainWidgetTitle ( "Z6 Manager" );

  QString ProgDir = QString ( qApp->argv() [0] ) ;
  int i = ProgDir.findRev ( "/" );
  ProgDir.remove ( i+1, ProgDir.length() - i );

  QWidget *myWidget = new QWidget ( this );
  //myWidget->setGeometry(0,0,240,320);
  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );
  QHBoxLayout *myHBoxLayout = new QHBoxLayout;
  myHBoxLayout->setSpacing ( 4 );
  myHBoxLayout->setMargin ( 10 );

  QLabel *myLabel = new QLabel ( myWidget );
  myLabel->setPixmap ( QPixmap ( "" ) );
  myLabel->setScaledContents ( false );
  myHBoxLayout->addWidget ( myLabel );

  myLabel = new QLabel ( QString ( "<qt><img src=%1/images/icon.png><br>"
                                   "<font size=\"+1\">Z6 Manager </font><font size=\"-1\">"
                                   "  v2.1<br><br>Motorola Z6 Linuxmod 2.1<br><br>developermoto.com/es<br>modmymoto.com<br>"
                                   "<br>(C) 2009. <br>CepiPerez / segnini75 / c_ro87"
                                   "</font></qt>" ).arg(ProgDir) , myWidget );
  myHBoxLayout->addWidget ( myLabel, 1 );
  myVBoxLayout->addLayout ( myHBoxLayout );

  QSpacerItem* spacer = new QSpacerItem ( 8, 8, QSizePolicy::Minimum, QSizePolicy::Expanding );
  myVBoxLayout->addItem ( spacer );

  //myLabel = new QLabel ( "Licensed under the GNU GPL.", myWidget );
  //myVBoxLayout->addWidget ( myLabel );
  setContentWidget ( myWidget );

  ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );
  softKey->setText ( ZSoftKey::LEFT, "Aceptar", ( ZSoftKey::TEXT_PRIORITY ) 0 );
  softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( accept() ) );
  setCSTWidget ( softKey );
}
Пример #27
0
ZAboutDialog::ZAboutDialog()
    :MyBaseDlg()
{
  QWidget *myWidget = new QWidget ( this );
  //myWidget->setGeometry(0,0,240,320);
  QVBoxLayout *myVBoxLayout = new QVBoxLayout ( myWidget, 0 );
  QHBoxLayout *myHBoxLayout = new QHBoxLayout;
  myHBoxLayout->setSpacing ( 4 );
  myHBoxLayout->setMargin ( 0 );

  QLabel *myLabel = new QLabel ( myWidget );
  myLabel->setPixmap ( QPixmap ( "folder.png" ) );
  myLabel->setScaledContents ( false );
  myHBoxLayout->addWidget ( myLabel );

  myLabel = new QLabel ( QString ( "<qt>zAlarm 0.2<br>"
                                   "<font size=\"-1\">zAlarm alarm time changer</font></qt>" 
"<font size=\"-1\">Base GUI based on zGui 0.7.4g by BeZ </font></qt>"), myWidget );
  myHBoxLayout->addWidget ( myLabel, 1 );
  myVBoxLayout->addLayout ( myHBoxLayout );

  myLabel = new QLabel ( QString ( "<qt><font size=\"-1\"><p>Copyright (C) 2008 c_ro87<br>"
                                   "<tt>&lt;[email protected]&gt;</tt><br></font></qt>" ),
                         myWidget );
  myVBoxLayout->addWidget ( myLabel );

  QSpacerItem* spacer = new QSpacerItem ( 8, 8, QSizePolicy::Minimum, QSizePolicy::Expanding );
  myVBoxLayout->addItem ( spacer );

  myLabel = new QLabel ( "www.modmymoto.com", myWidget );
  myVBoxLayout->addWidget ( myLabel );
  setContentWidget ( myWidget );

  ZSoftKey *softKey = new ZSoftKey ( NULL, this, this );
  softKey->setText ( ZSoftKey::LEFT, "OK", ( ZSoftKey::TEXT_PRIORITY ) 0 );
  //softKey->setText ( ZSoftKey::RIGHT, "Reject", ( ZSoftKey::TEXT_PRIORITY ) 0 );
  //softKey->setClickedSlot ( ZSoftKey::RIGHT, this, SLOT ( reject() ) );
  softKey->setClickedSlot ( ZSoftKey::LEFT, this, SLOT ( accept() ) );
  setCSTWidget ( softKey );
}
Пример #28
0
QLabel* Obstacle::spawnObstacles(QWidget *parent)
{
    Obstacle& o = Obstacle::instance();

    QLabel * enemyLabel = new QLabel(parent);
    Object * enemyObject;

    int enemySelect = rand() % 3;

    if(enemySelect==0){
        QMovie * dogMovie = new QMovie(":/dog.gif");
        enemyObject = new MadDog();
        enemyLabel->setMovie(dogMovie);
        enemyLabel->setGeometry(parent->width(),460,128,192);
        dogMovie->start();
    }else if(enemySelect == 1){
        enemyObject = new LawnMower;
        QPixmap mower(":/lawnmower2.png");
        enemyLabel->setPixmap(mower);
        enemyLabel->setGeometry(parent->width(), 514, 128,128);
    }else if(enemySelect==2){
        enemyObject =new Hole;
        QPixmap hole(":/hole.png");
        enemyLabel->setPixmap(hole);
        enemyLabel->setGeometry(parent->width(),615,128,768);
    }

    enemyLabel->setScaledContents(true);
    enemyLabel->show();

    objects.push_back(enemyObject);
    spawnedObstacles.push_back(enemyLabel);

    return enemyLabel;


}
Пример #29
0
QLayout *AboutDlg::initUserGuideLayout()
{
    // The user guide layout has a label (User Guide) and a PDF logo.

    guideLabel = new QLabel();
    guideLabel->setMaximumSize(112, 32);
    guideLabel->setAlignment(Qt::AlignCenter);

    QLabel * pdfLogo = new QLabel();
    pdfLogo->setMaximumSize(32, 32);
    pdfLogo->setPixmap(QPixmap(":/images/logo-pdf.png"));
    pdfLogo->setScaledContents(true);
    pdfLogo->setAlignment(Qt::AlignCenter);

    QHBoxLayout * userGuideLayout = new QHBoxLayout();
    userGuideLayout->setSizeConstraint(QLayout::SetMaximumSize);
    userGuideLayout->setSpacing(5);
	userGuideLayout->addSpacerItem(new QSpacerItem(100, 32, QSizePolicy::Maximum, QSizePolicy::Fixed));
    userGuideLayout->addWidget(guideLabel);
    userGuideLayout->addWidget(pdfLogo);
	userGuideLayout->addSpacerItem(new QSpacerItem(100, 32, QSizePolicy::Maximum, QSizePolicy::Fixed));

    return userGuideLayout;
}
Пример #30
0
void K3bIsoImageWritingDialog::setupGui()
{
  QWidget* frame = mainWidget();

  // image
  // -----------------------------------------------------------------------
  QGroupBox* groupImageUrl = new QGroupBox( 1, Qt::Horizontal, i18n("Image to Burn"), frame );
  m_editImagePath = new KURLRequester( groupImageUrl );
  m_editImagePath->setMode( KFile::File|KFile::ExistingOnly );
  m_editImagePath->setCaption( i18n("Choose Image File") );
  m_editImagePath->setFilter( i18n("*.iso *.ISO|ISO9660 Image Files") + "\n"
			      + i18n("*|All Files") );

  connect( m_editImagePath->lineEdit(), SIGNAL( textChanged ( const QString & ) ), this,  SLOT( slotWriterChanged() ) );

  // image info
  // -----------------------------------------------------------------------
  m_infoView = new K3bListView( frame );
  m_infoView->addColumn( "key" );
  m_infoView->addColumn( "value" );
  m_infoView->header()->hide();
  m_infoView->setNoItemText( i18n("No image file selected") );
  m_infoView->setSorting( -1 );
  m_infoView->setAlternateBackground( QColor() );
  m_infoView->setFullWidth(true);
  m_infoView->setSelectionMode( QListView::NoSelection );

  connect( m_infoView, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)),
	   this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&)) );

  m_writerSelectionWidget = new K3bWriterSelectionWidget( frame );

  // options
  // -----------------------------------------------------------------------
  QTabWidget* optionTabbed = new QTabWidget( frame );

  QWidget* optionTab = new QWidget( optionTabbed );
  QGridLayout* optionTabLayout = new QGridLayout( optionTab );
  optionTabLayout->setAlignment( Qt::AlignTop );
  optionTabLayout->setSpacing( spacingHint() );
  optionTabLayout->setMargin( marginHint() );

  QGroupBox* writingModeGroup = new QGroupBox( 1, Vertical, i18n("Writing Mode"), optionTab );
  writingModeGroup->setInsideMargin( marginHint() );
  m_writingModeWidget = new K3bWritingModeWidget( writingModeGroup );


  // copies --------
  QGroupBox* groupCopies = new QGroupBox( 2, Qt::Horizontal, i18n("Copies"), optionTab );
  groupCopies->setInsideSpacing( spacingHint() );
  groupCopies->setInsideMargin( marginHint() );
  QLabel* pixLabel = new QLabel( groupCopies );
  pixLabel->setPixmap( SmallIcon( "cdcopy", KIcon::SizeMedium ) );
  pixLabel->setScaledContents( false );
  m_spinCopies = new QSpinBox( groupCopies );
  m_spinCopies->setMinValue( 1 );
  m_spinCopies->setMaxValue( 999 );
  // -------- copies

  QGroupBox* optionGroup = new QGroupBox( 3, Vertical, i18n("Settings"), optionTab );
  optionGroup->setInsideMargin( marginHint() );
  optionGroup->setInsideSpacing( spacingHint() );
  m_checkDummy = K3bStdGuiItems::simulateCheckbox( optionGroup );
  m_checkVerify = K3bStdGuiItems::verifyCheckBox( optionGroup );


  optionTabLayout->addWidget( writingModeGroup, 0, 0 );
  optionTabLayout->addWidget( groupCopies, 1, 0 );
  optionTabLayout->addMultiCellWidget( optionGroup, 0, 1, 1, 1 );
  optionTabLayout->setRowStretch( 1, 1 );
  optionTabLayout->setColStretch( 1, 1 );

  optionTabbed->addTab( optionTab, i18n("Settings") );


  QGridLayout* grid = new QGridLayout( frame );
  grid->setSpacing( spacingHint() );
  grid->setMargin( 0 );

  grid->addWidget( groupImageUrl, 0, 0 );
  grid->addWidget( m_infoView, 1, 0 );
  grid->addWidget( m_writerSelectionWidget, 2, 0 );
  grid->addWidget( optionTabbed, 3, 0 );

  grid->setRowStretch( 1, 1 );
}