示例#1
0
Queue::Queue(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Queue)
{
    ui->setupUi(this);
    QGraphicsScene *scene = new QGraphicsScene(this);
    ui->graphicsView->setScene(scene);
    QPixmap bkgnd(":files/images/bckgnd.png");
    bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio);
    QPalette palette;
    palette.setBrush(QPalette::Background, bkgnd);
    this->setPalette(palette);
    QRectF coords;
    coords.setX(-500); coords.setY(-500);
    coords.setWidth(1000); coords.setHeight(1000);
    rPoint.setX(-500);
    rPoint.setY(-387);
    rLineCoords.setLine(-480, -387, -480, -410);
    qList = new Ui::List(ui->graphicsView, scene, coords, rPoint, rLineCoords, "Rear");

    QFont font;
    fPoint.setX(-500);
    fPoint.setY(-500);
    fLineCoords.setLine(-480, -480, -480, -460);
    fLabel = ui->graphicsView->scene()->addText("Front", font);
    fLabel->setPos(fPoint);
    fLine = ui->graphicsView->scene()->addLine(fLineCoords);
    v = new QIntValidator(0, 65535, this);
    ui->lineEdit->setValidator(v);
}
示例#2
0
void CheckButton::OnRender(suic::DrawingContext * drawing)
{
    if (GetStyle())
    {
        // 
        // 先绘制背景
        //
        suic::Rect drawrect(0, 0, RenderSize().cx, RenderSize().cy);
        suic::ImageBrushPtr bkgnd(suic::Render::GetProperty(this, GetStyle().get(), InternalBackgrount()));

        if (bkgnd)
        {
            suic::Rect rectBk = bkgnd->GetContentBrounds();

            drawrect.right = drawrect.left + rectBk.Width();
            drawrect.top += (drawrect.Height() - rectBk.Height()) / 2;
            drawrect.bottom = drawrect.top + rectBk.Height();

            bkgnd->Draw(drawing, &drawrect);
        }

        //
        // 绘制文字
        //
        drawrect.top = 0;
        drawrect.bottom = RenderSize().cy;
        drawrect.left = drawrect.right + GetPadding().left;
        drawrect.right = RenderSize().cx;

        suic::Render::RenderText(drawing, this, GetText(), &drawrect, true);
    }
}
示例#3
0
static void hclr(void) {
	// F3F2
	a=0;			// black background
	ram[HGR_BITS]=a;
	bkgnd();

}
示例#4
0
void ComboBox::OnRender(suic::DrawingContext * drawing)
{
    suic::StylePtr styleArrow = FindResource(_T("ComboBox.Down"));

    suic::Point pt;
    suic::Rect drawrect(pt.x, pt.y, RenderSize().cx, RenderSize().cy);

    // 
    // 先绘制背景
    //
    if (GetBackground())
    {
        GetBackground()->Draw(drawing, &drawrect);
    }

    // 获取下拉箭头的设置
    if (styleArrow.get())
    {
        suic::BrushPtr bkgnd(suic::Render::GetProperty(this, styleArrow.get(), _T("Background")));

        if (bkgnd)
        {
            suic::Rect downRect = drawrect;

            downRect.Deflate(GetBorderThickness());
            downRect.left = downRect.right - 16;

            bkgnd->Draw(drawing, &downRect);
        }
    }

    suic::Render::RenderBorder(drawing, this, &drawrect);
}
示例#5
0
LoginWindow::LoginWindow(QWidget *parent) : QMainWindow(parent),ui(new Ui::LoginWindow)
{
    ui->setupUi(this);
    this->setFixedSize(545,418);
      QPixmap bkgnd("C:/Users/HP/Desktop/images/Vote_login.jpg");
      bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio);
      QPalette palette;
      palette.setBrush(QPalette::Background, bkgnd);
      this->setPalette(palette);
}
示例#6
0
Gesture::Gesture(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Gesture)
{
    ui->setupUi(this);
    QPixmap bkgnd("/home/mukul/FinalYearProj/Augmented/Augmented/SmartCam_UI/3.jpg");
    bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio);
    QPalette palette;
    palette.setBrush(QPalette::Background, bkgnd);
    this->setPalette(palette);
}
SignUp_in::SignUp_in(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::SignUp_in)
{
    ui->setupUi(this);
    QPixmap bkgnd("/Users/alireza/Documents/Computer/Qt/Tank/Pictures/1.jpg");
    bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio);
    QPalette palette;
    palette.setBrush(QPalette::Background, bkgnd);
    this->setPalette(palette);
}
RemoveCandidate::RemoveCandidate(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::RemoveCandidate)
{
    ui->setupUi(this);

    QPixmap bkgnd("C:/Users/HP/Desktop/images/DBA_bkgnd.jpg");
    bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio);
    QPalette palette;
    palette.setBrush(QPalette::Background, bkgnd);
    this->setPalette(palette);
}
示例#9
0
shareDialog::shareDialog(QWidget *parent) :
    QDialog(parent),
    ui_core(new Ui::shareDialog)
{
    qDebug()<< "object created";
    ui_core->setupUi(this);
    ui_core->specificradioButton->setChecked(true);
    this->on_specificradioButton_clicked();
    //ui_core->lineEdit->setText();
    QPixmap bkgnd("./download.jpg");
    bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio);
    QPalette palette;
        palette.setBrush(QPalette::Background, bkgnd);
        this->setPalette(palette);

}
示例#10
0
文件: users.cpp 项目: HackeaMesta/Qt
Users::Users(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Users)
{
    ui->setupUi(this);
    /*
     * Carga la imagen para el background
    */
    QPixmap bkgnd("../imagenes/system/background.jpg");
    bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio);
    QPalette palette;
    palette.setBrush(QPalette::Background, bkgnd);
    this->setPalette(palette);

    loadData();
}
示例#11
0
form_map::form_map(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::form_map)
{
    ui->setupUi(this);

    QPixmap bkgnd("bg2.png");
    bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio);
    QPalette palette;
    palette.setBrush(QPalette::Background, bkgnd);
    this->setPalette(palette);

    ui->btn_load->click();

    QTimer *t=new QTimer(this);
    connect(t,SIGNAL(timeout()),this,SLOT(refress()));
    t->start(10000);
}
示例#12
0
void MainWindow::setEndNodeStyle(NodeItem* node)
{
    // Change the background style
    QLinearGradient bkgnd(-NodeItem::Radius, -NodeItem::Radius,
        NodeItem::Radius / 2, NodeItem::Radius / 2);
    bkgnd.setColorAt(0, QColor(  0, 255,  38));
    bkgnd.setColorAt(1, QColor(255, 255, 255));
    node->setBackground(bkgnd);

    // Change the border pen
    QBrush brdr(QColor(19, 174, 28));
    node->setBorderPen(QPen(brdr, NodeItem::Border));

    // Change the emphasis
    QRadialGradient emph(0, 0, NodeItem::Radius + 2 * NodeItem::EmphWidth);
    emph.setColorAt(0.50f, QColor(109, 255, 116, 192));
    emph.setColorAt(0.75f, QColor(255, 255, 255,   0));
    node->setEmphasisBrush(emph);
}
示例#13
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    setFixedWidth (450);
    setFixedHeight (330);

    QRect position = frameGeometry();
    position.moveCenter(QDesktopWidget().availableGeometry().center());
    move(position.topLeft());

    ui->setupUi(this);

    QPixmap bkgnd(":msi-ledkey.jpg");
    bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio);
    QPalette palette;
    palette.setBrush(QPalette::Background, bkgnd);
    this->setPalette(palette);
}
示例#14
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
#ifdef __APPLE__
     QDir bin(QCoreApplication::applicationDirPath());
     bin.cdUp();
     bin.cdUp();
     bin.cdUp();
     QDir::setCurrent(bin.absolutePath());
 #endif
     //Declare Variables and set background image for main window
    ui->setupUi(this);
    QPixmap bkgnd("images/Snake.png");
    bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio);
    QPalette palette;
    palette.setBrush(QPalette::Background, bkgnd);
    this->setPalette(palette);

    join=NULL;
}
示例#15
0
void Slider::OnRender(suic::DrawingContext * drawing)
{
    // 先绘制背景
    suic::Rect rcdraw(0, 0, RenderSize().cx, RenderSize().cy);
    suic::TriggerPtr trg(GetStyle()->GetTrigger());
    suic::ImageBrushPtr bkgnd(trg->GetValue(suic::BACKGROUND));

    if (!bkgnd)
    {
        if (GetOrientation() == CoreFlags::Horizontal)
        {
            rcdraw.top = (RenderSize().cy - GetDesiredSize().cy) / 2;
            rcdraw.bottom = rcdraw.top + GetDesiredSize().cy;
        }
        else
        {
            rcdraw.left = (RenderSize().cx - GetDesiredSize().cx) / 2;
            rcdraw.right = rcdraw.left + GetDesiredSize().cx;
        }

        suic::UIRender::DrawBackground(drawing, trg, &rcdraw);
    }
    else
    {
        suic::Rect rect = bkgnd->GetContentBrounds();

        if (GetOrientation() == CoreFlags::Horizontal)
        {
            rcdraw.top = (RenderSize().cy - rect.Height()) / 2;
            rcdraw.bottom = rcdraw.top + rect.Height();
        }
        else
        {
            rcdraw.left = (RenderSize().cx - rect.Width()) / 2;
            rcdraw.right = rcdraw.left + rect.Width();
        }

        bkgnd->Draw(drawing, &rcdraw);
    }
}
示例#16
0
void ProgressBar::OnRender(suic::DrawingContext * drawing)
{
    // 先绘制背景
    suic::Rect elemrect(0, 0, RenderSize().cx, RenderSize().cy);

    suic::TriggerPtr trg(suic::UIRender::GetTriggerByStatus(this, GetStyle()));
    suic::UIRender::DrawBackground(drawing, trg, &elemrect);

    //
    // 绘制进度条状态
    //
    suic::ImageBrushPtr bkgnd(trg->GetValue(_T("Thumb")));

    if (bkgnd)
    {
        suic::Rect rcdraw(elemrect);

        // 水平
        if (GetOrientation() == CoreFlags::Horizontal)
        {
            LONG iOff = (LONG)((GetValue() - Minimum()) * (double)(rcdraw.right - rcdraw.left) / (Maximum() - Minimum()));
            rcdraw.right = rcdraw.left + iOff;
        }
        else
        {
            LONG iOff = (LONG)((double)(rcdraw.bottom - rcdraw.top) * (GetValue() - Minimum()) / (Maximum() - Minimum()));
            rcdraw.top = rcdraw.bottom - iOff;
        }

        if (!rcdraw.Empty())
        {
            bkgnd->Draw(drawing, &rcdraw);
        }
    }

    suic::UIRender::DrawText(drawing, GetText(), trg, &elemrect
        , GetHorizontalContentAlignment(), GetVerticalContentAlignment());
}
示例#17
0
suic::Size CheckButton::MeasureOverride(const suic::Size& size)
{
    suic::Size ret;

    if (GetStyle())
    {
        suic::SetterCollectionPtr& setPtr = GetStyle()->Setters();
        suic::ImageBrushPtr bkgnd(setPtr->GetValue(InternalBackgrount()));

        if (bkgnd)
        {
            suic::Size sizeImg;
            suic::Rect rectBk;

            rectBk = bkgnd->GetContentBrounds();       
            ret = suic::Render::MeasureTextSize(GetText(), GetFont());

            ret.cx += rectBk.Width() + 4;
            ret.cy += rectBk.Height();
        }
    }

    return ret;
}
示例#18
0
PopUp::PopUp(ScreensContainer *parent) : QWidget(parent)
{

    this->setWindowFlags(Qt::Popup);
    if (this->objectName().isEmpty())
        this->setObjectName("PopUpWithButtons");
    this->resize(800, 350);
    QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
    sizePolicy.setHorizontalStretch(0);
    sizePolicy.setVerticalStretch(0);
    sizePolicy.setHeightForWidth(this->sizePolicy().hasHeightForWidth());
    this->setSizePolicy(sizePolicy);
    this->setMinimumSize(QSize(800, 350));
    this->setMaximumSize(QSize(1600, 700));
    this->setAutoFillBackground(true);

    QPixmap bkgnd(":alarmpopup");
    bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio);
    QPalette palette;
    palette.setBrush(QPalette::Background, bkgnd);
    this->setPalette(palette);
    this->setGeometry(0, 50+30, this->width(), this->height());


//    QWidget * widget = new QWidget(this);
//    widget->setObjectName(QStringLiteral("widget"));
//    widget->setGeometry(QRect(485, 75, 202, 191));
//    QVBoxLayout* verticalLayout = new QVBoxLayout(widget);

//    verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
//    verticalLayout->setContentsMargins(0, 0, 0, 0);

//    PopupButton * popupButton = new PopupButton(widget);
//    PopupButton * popupButton_2 = new PopupButton(widget);

//    verticalLayout->setGeometry(QRect(600, 60,popupButton->width() , popupButton->height()));
//    verticalLayout->addWidget(popupButton);
//    verticalLayout->addWidget(popupButton_2);
//    QPushButton * popupButton = new QPushButton(widget);

//    popupButton->setAutoFillBackground(true);
//    popupButton->setObjectName("popupButton");
//    QSizePolicy sizePolicy1(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
//    sizePolicy1.setHorizontalStretch(1);
//    sizePolicy1.setVerticalStretch(1);
//    sizePolicy1.setHeightForWidth(popupButton->sizePolicy().hasHeightForWidth());
//    popupButton->setSizePolicy(sizePolicy1);
//    popupButton->setMinimumSize(QSize(200, 50));
//    popupButton->setMaximumSize(QSize(400, 100));
//    QFont font;
//    font.setPointSize(18);
//    font.setBold(true);
//    font.setWeight(75);
//    font.setStyleStrategy(QFont::PreferAntialias);
//    popupButton->setFont(font);


//    QPushButton * popupButton_2 = new QPushButton(widget);
//    popupButton_2->setAutoFillBackground(true);
//    popupButton_2->setObjectName("popupButton_2");
//    sizePolicy1.setHeightForWidth(popupButton_2->sizePolicy().hasHeightForWidth());
//    popupButton_2->setSizePolicy(sizePolicy1);
//    popupButton_2->setMinimumSize(QSize(200, 50));
//    popupButton_2->setMaximumSize(QSize(400, 100));
//    popupButton_2->setFont(font);


//    popupButton->raise();
//    popupButton_2->lower();

}
示例#19
0
//
/// Paint the item entirely.
//
void
TCheckList::PaintItem(DRAWITEMSTRUCT & drawInfo)
{
  TCheckListItem* item = GetItem(drawInfo.itemID);
  if (item == 0)
    return;

  const bool disabled = !item->IsEnabled() || (drawInfo.itemState & ODS_DISABLED);

  // Prepare DC
  //
  TDC dc(drawInfo.hDC);

  // Erase entire line
  //
  TRect rect(drawInfo.rcItem);
  TBrush bkgnd(TColor::SysWindow);
  dc.FillRect(rect, bkgnd);

  // Draw checkbox
  //
  TRect checkboxRect(rect.left+1,rect.top+1,
                     rect.left+CheckList_BoxWidth,rect.bottom-1);

  // Draw checkbox in 3D Windows Style
  //
  uint state;
  if (item->IsIndeterminate())
    state = TUIPart::Button3State|TUIPart::Checked;//TUIPart::Pushed;
  else
    state = TUIPart::ButtonCheck;

  if(item->IsChecked())
    state |= TUIPart::Checked;

  if (disabled)
    state |= TUIPart::Inactive;

  TUIPart().Paint(dc, checkboxRect, TUIPart::uiButton, (TUIPart::TState)state);

  // Draw select state with hightlight color
  //
  TRect textRect = rect;
  textRect.left = checkboxRect.right + 2;

  if (disabled)
  {
    dc.SetTextColor(TColor::SysGrayText);
    dc.SetBkColor(TColor::SysWindow);
  }
  else if (drawInfo.itemState & ODS_SELECTED)
  {
    TBrush fillBrush(TColor::SysHighlight);
    dc.FillRect(textRect, fillBrush);
    dc.SetTextColor(TColor::SysHighlightText);
    dc.SetBkColor(TColor::SysHighlight);
  }
  else
  {
    dc.SetTextColor(TColor::SysWindowText);
    dc.SetBkColor(TColor::SysWindow);
  }

  // Draw Text
  //
  textRect.left++;
  PaintText(dc, textRect, item->Text);
  textRect.left--;

  // Draw focus and selected states
  //
  if (drawInfo.itemState & ODS_FOCUS)
    dc.DrawFocusRect(textRect);
}